<template>
  <div>
    <Fu2></Fu2>
    <Ref ref="box"></Ref>
  </div>
</template>
<script>
import Fu2 from './houdai/Fu2.vue'
import Ref from './ref/Ref2.vue'


export default {
  name: '',
  components: {
    Fu2,
    Ref
  },
  provide () {
    return {
      ad: this.ad
    }
  },
  data () {
    return {

    }
  },
  created () {
  },
  computed: {
  },
  methods: {
  },
  mounted () {
    console.log(this);//打印this看看里面有啥，发现$refs
    console.log(this.$refs.box, 'app里面的this.$refs.box')
    console.log(this.$refs.box.ad);//拿到子组件里面的值，等同于子向父传值
    this.$refs.box.fn()//调用子组件里面的函数
  },
}
</script>
<style lang='less'  scoped>
</style>

